use crate::features::sgraph::{self};
use crate::features::users::modelsdbo::UserDBO;
use chrono::prelude::*;
use rbatis::core::db::DBExecResult;
use rbatis::crud::{Skip, CRUD};
use rbatis::executor::RbatisExecutor;
use rbatis::rbatis::Rbatis;

/// 通过 email 获取用户
pub async fn get_user_by_email(
  rbatis_pool: &Rbatis,
  email: &str,
) -> Result<UserDBO, rbatis::Error> {
  let email_wrapper = rbatis_pool.new_wrapper().eq("email", email);
  let user = rbatis_pool.fetch_by_wrapper::<UserDBO>(email_wrapper).await;

  user
}



